﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using mscook.core.domain;
using mscook.core.components;

namespace mscook.core.repositories
{
    public interface IRepository<T> where T : BaseObject
    {
        T Load(string id);
        T Load(int id);
        T Get(string id);
        T Get(int id);
        IList<T> GetAll();

        void SaveOrUpdate(T entity);
        void Update(T entity);
        bool Delete(string id);
        void Delete(int id);
        void PhysicsDelete(string id);
        void DeleteAll(IList<T> list);
        [Obsolete("GetPageList is deprecated, please use SelectPageList instead.")]
        IList<T> GetPageList(int start, int limit, out long total);
        IList<T> SelectPageList(int start, int limit, out long total);
        IList<T> GetLimitByIds(IList<string> ids, int start, int limit, out long total);
        IList<T> GetAllByIds(IList<string> ids);
        IList<T> SelectPageList(int start, int limit, out long total, System.Linq.Expressions.Expression<Func<T, bool>> expression);
    }

}
